package com.example.forum.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.forum.entity.TPermissions;
import com.example.forum.mapper.TPermissionsMapper;
import com.example.forum.service.ITPermissionsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author why
 * @since 2019-10-30
 */
@Service
public class TPermissionsServiceImpl extends ServiceImpl<TPermissionsMapper, TPermissions> implements ITPermissionsService {
    @Resource
    private TPermissionsMapper tmapper;
    public String[] getPermissionTargetByUserId(String userid){

        List<String> templist= tmapper.getPermissionTargetByUserId(userid);
        return (String[]) templist.toArray(new String[0]);
    }

    public List<String> getPermissionsAll(Integer permissiontype){

        List<String> templist= tmapper.getPermissionsAll(permissiontype);
        return templist;
    }

    public String[] GetPermissionIdByUserId(String userid){
        List<String> templist= tmapper.GetPermissionIdByUserId(userid);
        return (String[]) templist.toArray(new String[0]);
    }
}
